home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / dev / basic / PureBasic_Upd.lha / PureBasic_Update1.60 / PureBasic / PureInclude / devices / prtbase.pb < prev    next >
Encoding:
Text File  |  2000-09-10  |  5.1 KB  |  161 lines

  1. ;
  2. ; ** $VER: prtbase.h 1.10 (2.11.90)
  3. ; ** Includes Release 40.15
  4. ; **
  5. ; ** printer.device base structure definitions
  6. ; **
  7. ; ** (C) Copyright 1987-1993 Commodore-Amiga, Inc.
  8. ; **     All Rights Reserved
  9. ;
  10.  
  11. IncludePath   "PureInclude:"
  12.  
  13. ;XIncludeFile "dos/all.pb"
  14. ;XIncludeFile "intuition/all.pb"
  15.  
  16. XIncludeFile "exec/types.pb"
  17. XIncludeFile "exec/nodes.pb"
  18. XIncludeFile "exec/lists.pb"
  19. XIncludeFile "exec/ports.pb"
  20. XIncludeFile "exec/libraries.pb"
  21. XIncludeFile "exec/tasks.pb"
  22.  
  23. XIncludeFile "devices/parallel.pb"
  24. XIncludeFile "devices/serial.pb"
  25. XIncludeFile "devices/timer.pb"
  26. ;XIncludeFile "dos/dosextens.pb"
  27. ;XIncludeFile "intuition/intuition.pb"
  28.  
  29.  
  30. Structure DeviceData
  31.     dd_Device.Library ;  standard library node
  32.     *dd_Segment.l       ;  A0 when initialized
  33.     *dd_ExecBase.l       ;  A6 for exec
  34.     *dd_CmdVectors.l       ;  command table for device commands
  35.     *dd_CmdBytes.l       ;  bytes describing which command queue
  36.     dd_NumCommands.w   ;  the number of commands supported
  37. EndStructure
  38.  
  39. #P_OLDSTKSIZE = $0800 ;  stack size for child task (OBSOLETE)
  40. #P_STKSIZE = $1000 ;  stack size for child task
  41. #P_BUFSIZE = 256 ;  size of internal buffers for text i/o
  42. #P_SAFESIZE = 128 ;  safety margin for text output buffer
  43.  
  44. ;
  45. ; Here are the Union emulation under PureBasic. Enjoy the tricks :)
  46. ;
  47. Structure pd_Union1
  48.   StructureUnion
  49.     pd_p0.IOExtPar
  50.     pd_s0.IOExtSer
  51.   EndStructureUnion
  52. EndStructure
  53.  
  54. Structure pd_Union2
  55.   StructureUnion
  56.     pd_p1.IOExtPar
  57.     pd_s1.IOExtSer
  58.   EndStructureUnion
  59. EndStructure
  60.  
  61.  
  62. Structure  PrinterData
  63.  pd_Device.DeviceData
  64.  pd_Unit.MsgPort ;  the one and only unit
  65.  *pd_PrinterSegment.l ;  the printer specific segment
  66.  pd_PrinterType.w ;  the segment printer type
  67.     ;  the segment data structure
  68.  *pd_SegmentData.PrinterSegment
  69.  *pd_PrintBuf.b ;  the raster print buffer
  70.  *pd_PWrite.l ;  the write function
  71.  *pd_PBothReady.l ;  write function's done
  72.  
  73.   pd_ior0.pd_Union1 ; See the structures above
  74.  
  75. ;# pd_PIOR0 = pd_ior0\pd_p0
  76. ;# pd_SIOR0 = pd_ior0\pd_s0
  77.  
  78.   pd_ior1.pd_Union2 ; See the structures above
  79.  
  80. ;# pd_PIOR1 = pd_ior1\pd_p1
  81. ;# pd_SIOR1 = pd_ior1\pd_s1
  82.  
  83.  pd_TIOR.timerequest ;  timer I/O request
  84.  pd_IORPort.MsgPort ;  and message reply port
  85.  pd_TC.Task  ;  write task
  86.  pd_OldStk.b[#P_OLDSTKSIZE] ;  and stack space (OBSOLETE)
  87.  pd_Flags.b   ;  device flags
  88.  pd_pad.b   ;  padding
  89.  pd_Preferences.Preferences ;  the latest preferences
  90.  pd_PWaitEnabled.b  ;  wait function switch
  91.  ;  new fields for V2.0
  92.  pd_Flags1.b  ;  padding
  93.  pd_Stk.b[#P_STKSIZE] ;  stack space
  94. EndStructure
  95.  
  96. ;  Printer Class
  97. #PPCB_GFX = 0 ;  graphics (bit position)
  98. #PPCF_GFX = $1 ;  graphics (and/or flag)
  99. #PPCB_COLOR = 1 ;  color (bit position)
  100. #PPCF_COLOR = $2 ;  color (and/or flag)
  101.  
  102. #PPC_BWALPHA = $00 ;  black&white alphanumerics
  103. #PPC_BWGFX = $01 ;  black&white graphics
  104. #PPC_COLORALPHA = $02 ;  color alphanumerics
  105. #PPC_COLORGFX = $03 ;  color graphics
  106.  
  107. ;  Color Class
  108. #PCC_BW  = $01 ;  black&white only
  109. #PCC_YMC  = $02 ;  yellow/magenta/cyan only
  110. #PCC_YMC_BW = $03 ;  yellow/magenta/cyan or black&white
  111. #PCC_YMCB = $04 ;  yellow/magenta/cyan/black
  112. #PCC_4COLOR = $04 ;  a flag for YMCB and BGRW
  113. #PCC_ADDITIVE = $08 ;  not ymcb but blue/green/red/white
  114. #PCC_WB  = $09 ;  black&white only, 0 == BLACK
  115. #PCC_BGR  = $0A ;  blue/green/red
  116. #PCC_BGR_WB = $0B ;  blue/green/red or black&white
  117. #PCC_BGRW = $0C ;  blue/green/red/white
  118. ;
  119. ;  The picture must be scanned once for each color component, as the
  120. ;  printer can only define one color at a time.  ie. If 'PCC_YMC' then
  121. ;  first pass sends all 'Y' info to printer, second pass sends all 'M'
  122. ;  info, and third pass sends all C info to printer.  The CalComp
  123. ;  PlotMaster is an example of this type of printer.
  124. ;
  125. #PCC_MULTI_PASS = $10 ;  see explanation above
  126.  
  127. Structure PrinterExtendedData
  128.  *ped_PrinterName.b    ;  printer name, null terminated
  129.  *ped_Init.l      ;  called after LoadSeg
  130.  *ped_Expunge.l    ;  called before UnLoadSeg
  131.  *ped_Open.l      ;  called at OpenDevice
  132.  *ped_Close.l      ;  called at CloseDevice
  133.  ped_PrinterClass.b    ;  printer class
  134.  ped_ColorClass.b      ;  color class
  135.  ped_MaxColumns.b      ;  number of print columns available
  136.  ped_NumCharSets.b     ;  number of character sets
  137.  ped_NumRows.w      ;  number of 'pins' in print head
  138.  ped_MaxXDots.l      ;  number of dots max in a raster dump
  139.  ped_MaxYDots.l      ;  number of dots max in a raster dump
  140.  ped_XDotsInch.w      ;  horizontal dot density
  141.  ped_YDotsInch.w      ;  vertical dot density
  142.  *ped_Commands.l     ;  printer text command table
  143.  *ped_DoSpecial.l  ;  special command handler
  144.  *ped_Render.l     ;  raster render function
  145.  ped_TimeoutSecs.l     ;  good write timeout
  146.  ;  the following only exists if the segment version is >= 33
  147.  *ped_8BitChars.l     ;  conv. strings for the extended font
  148.  ped_PrintMode.l      ;  set if text printed, otherwise 0
  149.  ;  the following only exists if the segment version is >= 34
  150.  ;  ptr to conversion function for all chars
  151.  *ped_ConvFunc.l
  152. EndStructure
  153.  
  154. Structure PrinterSegment
  155.     ps_NextSegment.l  ;  (actually a BPTR)
  156.     ps_runAlert.l  ;  MOVEQ #0,D0 : RTS
  157.     ps_Version.w  ;  segment version
  158.     ps_Revision.w  ;  segment revision
  159.     ps_PED.PrinterExtendedData   ;  printer extended data
  160. EndStructure
  161.